<?php
// +----------------------------------------------------------------------
// | Ghome/Admin/Controller/IndexController
// +----------------------------------------------------------------------
// | Author: alex <gt199899@gmail.com>
// +----------------------------------------------------------------------
// | Version: 2014-06-24
// +----------------------------------------------------------------------
// | Copyright: Perfect Is Shit
// +----------------------------------------------------------------------
namespace Admin\Controller;
class IndexController extends InitController{

	/**
	 * index
	 * @access public
	 * @author alex
	 * @version 2014-06-24
	 * @copyright Perfect Is Shit
	 */
	public function index(){
// 		D('Base')->errorCheck(false, true);
		D('DForeverTree')->getTreeStruct();
		$this->display();
	}

	public function ext(){
		$this->display();
	}

	/**
	 * show menu
	 * ajax
	 * @access public
	 * @author alex
	 * @version 2014-06-24
	 * @copyright Perfect Is Shit
	 */
	public function menu(){
		IS_AJAX or throw_exception();
		$menu = array(
			array(
				'text'		=>	'ZCE',
				'iconCls'	=>	'icon-grid',
				'state'		=>	'closed',
				'children'	=>	array(
					array(
						'text'		=>	'Outline',
						'iconCls'	=>	'icon-gears',
						'src'		=>	U('Admin/ZCE/outline'),
					),
				),
			),
		);
		echo json_encode($menu);
	}

	public function test(){
// 		header('Content-Type: text/xml');
		$xmlDb = new \Lib\XmlDb\XmlDb(C('PHY_PATH.XMLDB'));
// 		$xmlDb->table('test')->field(array('f1'))->create();
// 		$xmlDb->table('test')->add(array('f2'=>'123', 'f2'=>'1'));
		dump($xmlDb->table('test')->where(array('f1'=>'f1'))->select());
		dump($xmlDb->table('test')->select());
	}
}